package com.gancp.controller;

import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * Created by GCP on 2018/4/28.
 */
@RequestMapping("/loginOut")
@Controller
public class LoginOutController {
    @RequestMapping("")
    public String loginOut(HttpServletRequest servletRequest) {
       /* HttpSession session = servletRequest.getSession();
        session.invalidate();*/
        // 使用shiro的登出操作
        SecurityUtils.getSubject().logout();
        return "login";
    }
}
